<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>MKTB15</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="../js/IDEA_body.js"
	type=text/javascript></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" type=text/javascript>
	function isConfirm(obj)
	{

		if(confirm('是否确认重置密码？'))
		{
			window.location.href="../account/resetAccountPass.html?accountCode="+obj;
		}
	}

     function delAccountInfo()
     {  
      	var flag =  document.getElementsByName("checkbox2");
      	var str='';   
      	var decide = false;     
         for(var i=0;i<flag.length;i++)
         {                
             if(flag[i].checked)
             {
                str += flag[i].value+',';
                
                decide = true;
               
             }
         }
         if(!decide)
         {
            alert('请选择需删除的记录！');
            
            return false;
         }
         else
         {
            str = str.substr(0,str.length-1);
         
           if(null != str && '' != str && "undefined" != str)
           {
              if(confirm('删除该账号信息，对应的岗位关系也会删除，请您确认?'))
              {
                 myform.action='<%=request.getContextPath()%>/account/delAccountInfo.html?accountId='+str;
                 myform.submit();       
             }
          }
        }
     }
     
     function allCheckBox(obj)
     {
        var flag =  document.getElementsByName("checkbox2");               
        if(obj.checked == true)
        {
          for(var i = 0; i < flag.length; i++)
          {
             flag[i].checked = true;
          }
        }
        else
        {
            for(var i = 0; i < flag.length; i++)
          {
             flag[i].checked = false;
          }
        }
     }
     
     function cancelMyBox()
     {
        var box =  document.getElementsByName("checkbox2");
        var mybox =  document.getElementsByName("mybox");        
        var flag = true;
        
        for(var i = 0; i < box.length; i++)
        {
            if(!box[i].checked)
            {
               flag = false;
            }
        }
        if(flag)
        {
           mybox[0].checked=true;
        }
        else
        {
           mybox[0].checked=false;
        }
     }
     
</SCRIPT>
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
</HEAD>
<BODY>
<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
		<TBODY>
			<TR>
				<TD height="100%" bgcolor="#FFFFFF" class=right_bg><iss:blank />
					<table width="100%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="20">&nbsp;</td>
							<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>
								&gt; <a href="#"
								class="blue_1">权限管理</td>
						</tr>
					</table>

					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						background="../images/bg_body_title.jpg" class="list_border1">
						<tr>
							<td width="10">&nbsp;</td>
							<td>
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="../images/pic_title_1.jpg" name="imgL1"
											width="8" height="24" id="imgL1"></td>
										<td valign="bottom" class="text_12_border" nowrap="nowrap"
											style="cursor: hand;" id="tdTitle1">查询帐号信息</td>
										<td><img src="../images/pic_title_2.jpg" name="imgR1"
											width="8" height="24" id="imgR1"></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				class="list_border2">
				<tr>
					<td align="center" valign="top">
					<table width="98%" height="20" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<table width="98%" border="0" cellspacing="0" cellpadding="0">
						<form name="myform" method="POST"
							action="../account/queryUserAccountInfo.html">
						<tr>
							<td width="20">&nbsp;</td>
							<td width="60">账号名称：</td>
							<td width="100"><input type="text" name="accountCode"
								id="accountCode" value="${accountCode }"></td>	
							<td width="20">&nbsp;</td>
							<td width="60">公司名称：</td>
							<td width="100"><input type="text" name="companyName"
								id="companyName" value="${companyName }"></td>				
							<td width="20">&nbsp;</td>
							<td><input name="Submit" type="submit" class="button_normal"
								value="查  询"></td>
						</tr>
						</form>
					</table>

					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<TABLE width="98%" border=0 cellPadding=0 cellSpacing=0
						class=list_border>
						<TBODY>
							<TR>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title><input type="checkbox"
									name="mybox" onclick="allCheckBox(mybox);"></TD>

								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title>账号名称</TD>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title>所属公司</TD>
								<TD width="1" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title>岗位名称</TD>

								<TD width="1" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD class=list_title>用户名称</TD>
								

								
								<TD width="2" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title>账号状态</TD>

								<TD width="2" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD  class=list_title>操作</TD>


							</TR>
							<c:forEach var="bean" items="${displayBean}"
								varStatus="status">
								<c:choose>
									<c:when test="${status.index%2==0}">
										<TR class=list_td_white1>
									</c:when>
									<c:when test="${status.index%2==1}">
										<TR class=list_td_white0>
									</c:when>
								</c:choose>
								<TD></TD>
								<TD align="center"><input type="checkbox" name="checkbox2"
									value="${bean.accountId}" onclick="cancelMyBox();"></TD>
								<TD></TD>
								<TD align="left">${bean.accountName}</TD>
								<TD></TD>
								<TD align="left">	${bean.companyName }								
								</TD>
								<TD></TD>
								<TD align="center"><c:forEach var="accountStation"
									items="${bean.stationList}" varStatus="statusd">								
								     ${accountStation.stationName}							
								</c:forEach></TD>
								<TD></TD>
								<TD align="center">	${bean.userName }								
								</TD>
								<TD></TD>
								<TD align="center"><c:choose>
									<c:when test="${bean.accountState=='ENABLE'}">
										<font color="green">正常</font>
									</c:when>
									<c:when test="${bean.accountState=='DISABLE'}">
										<font color="gray">禁用</font>
									</c:when>
								</c:choose></TD>
								<TD align="center"></TD>
								<TD align="center">
								<c:if test="${userType eq 1 or userType eq 2 }">
								<a href='#' onClick="isConfirm('${bean.accountName}')">重置密码</a>
								<a href='#' onClick="window.location.href='../account/updateUserAccountInfo.html?accountId=${bean.accountId}&accountCode=${accountCode}&companyName=${companyName}&pages=${pages}'">修改</a>
								</c:if>
								</TD>
								<TD></TD>
								</TR>
							</c:forEach>
						</TBODY>
					</TABLE>
					<table width="98%" height="24" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td align="right"><iss:navigation /></td>
						</tr>
					</table>
					<c:if test="${userType eq 1 or userType eq 2 }">
					<table width="98%" height="28" border="0" cellpadding="0"
						cellspacing="0">
						<tr>

							<td valign="top"><input name="Submit22" type="submit"
								class="button_normal" value="新  增"
								onClick="window.location.href='<%=request.getContextPath()%>/account/insertUserAccountInfo.html'">
							&nbsp;&nbsp; <input name="Submit32" type="submit"
								class="button_normal" value="删  除" onClick="delAccountInfo();"></td>
						</tr>
					</table>
					</c:if>
			</table>
			<table width="98%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			</TD>
		</TR>
	</TBODY>
</TABLE>
</BODY>
</HTML>
